package net.top.viewer.managers
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	public class EventManager extends EventDispatcher
	{
		/** Application event bus instance */
		public static const instance:EventManager = new EventManager();
			
		public function EventManager(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/**
		 * The factory method is used to create a instance of the EventBus. It returns
		 * the only instance of EventBus and makes sure no another instance is created.
		 */
		[Deprecated(replacement="instance")]
		public static function getInstance():EventManager
		{
			return instance;
		}
		
		/**
		 * Basic dispatch function, dispatches simple named events. In the case
		 * that the event is only significant by the event token (type string),
		 * this new dispatch method simplify the code.
		 */
		[Deprecated(replacement="AppEvent.dispatch")]
		public function dispatch(type:String):Boolean
		{
			return dispatchEvent(new Event(type));
		}
	}
}